#include "RgbLed.h"
#include "HAL_GPIO.h"
#include "HAL_PWM.h"

#ifdef STC15
int RGBLED_begin(RgbLed *led,unsigned char rport,unsigned char gport,unsigned char bport)
{
	if(rport<2 || rport>7)
		return -1;
	else if(rport<2 || rport>7)
		return -1;
	else if(bport<2 || bport>7)
		return -1;
	led->redPort=rport;
	led->greenPort=gport;
	led->bluePort=bport;
	PWM_begin(rport,1,DISABLE);
	PWM_begin(gport,1,DISABLE);
	PWM_begin(bport,1,DISABLE);
	return 0;
}
#endif

#ifdef STC8
int RGBLED_begin(RgbLed *led,unsigned char rport,unsigned char gport,unsigned char bport)
{
	if(rport<0 || rport>7)
		return -1;
	else if(rport<0 || rport>7)
		return -1;
	else if(bport<0 || bport>7)
		return -1;
	led->redPort=rport;
	led->greenPort=gport;
	led->bluePort=bport;
	PWM_begin(rport,1,DISABLE);
	PWM_begin(gport,1,DISABLE);
	PWM_begin(bport,1,DISABLE);
	return 0;
}
#endif

void RGBLED_set(RgbLed *led,unsigned int red,unsigned int green,unsigned int blue)
{
	#ifdef GAMMA_NOT
	PWM_set(led->redPort,red);
	PWM_set(led->greenPort,green);
	PWM_set(led->bluePort,blue);
	#endif
	
	#if defined(GAMMA_10)||defined(GAMMA_15)||defined(GAMMA_20)||defined(GAMMA_26)||defined(GAMMA_30)
	PWM_set(led->redPort,gamma[red]);
	PWM_set(led->greenPort,gamma[green]);
	PWM_set(led->bluePort,gamma[blue]);
	#endif
}

void RGBLED_end(RgbLed *led)
{
	PWM_end(led->redPort);
	PWM_end(led->greenPort);
	PWM_end(led->bluePort);
}



#ifdef GAMMA_30
code unsigned int gamma[1000]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,8,8,8,8,8,
8,8,8,8,9,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,11,
12,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,15,16,
16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,19,19,20,20,20,20,21,21,
21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,
27,28,28,28,28,29,29,29,30,30,30,30,31,31,31,32,32,32,32,33,33,33,34,34,34,
35,35,35,36,36,36,37,37,37,38,38,38,39,39,39,40,40,40,41,41,41,42,42,43,43,
43,44,44,44,45,45,45,46,46,47,47,47,48,48,49,49,49,50,50,51,51,51,52,52,53,
53,54,54,54,55,55,56,56,57,57,58,58,58,59,59,60,60,61,61,62,62,63,63,64,64,
64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,73,73,74,74,75,75,76,76,77,
77,78,78,79,80,80,81,81,82,82,83,83,84,85,85,86,86,87,88,88,89,89,90,91,91,
92,92,93,94,94,95,95,96,97,97,98,99,99,100,101,101,102,103,103,104,104,105,106,106,107,
108,109,109,110,111,111,112,113,113,114,115,116,116,117,118,118,119,120,121,121,122,123,124,124,125,
126,127,127,128,129,130,130,131,132,133,133,134,135,136,137,137,138,139,140,141,141,142,143,144,145,
146,146,147,148,149,150,151,151,152,153,154,155,156,157,157,158,159,160,161,162,163,164,165,165,166,
167,168,169,170,171,172,173,174,175,176,177,178,178,179,180,181,182,183,184,185,186,187,188,189,190,
191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,
217,218,219,220,221,223,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,241,242,243,244,
245,246,248,249,250,251,252,254,255,256,257,258,260,261,262,263,265,266,267,268,270,271,272,273,275,
276,277,278,280,281,282,284,285,286,287,289,290,291,293,294,295,297,298,299,301,302,303,305,306,308,
309,310,312,313,314,316,317,319,320,321,323,324,326,327,329,330,331,333,334,336,337,339,340,342,343,
344,346,347,349,350,352,353,355,356,358,359,361,362,364,366,367,369,370,372,373,375,376,378,380,381,
383,384,386,387,389,391,392,394,395,397,399,400,402,404,405,407,409,410,412,413,415,417,419,420,422,
424,425,427,429,430,432,434,436,437,439,441,442,444,446,448,449,451,453,455,457,458,460,462,464,465,
467,469,471,473,475,476,478,480,482,484,486,487,489,491,493,495,497,499,501,502,504,506,508,510,512,
514,516,518,520,522,524,526,528,529,531,533,535,537,539,541,543,545,547,549,551,553,555,557,559,562,
564,566,568,570,572,574,576,578,580,582,584,586,588,591,593,595,597,599,601,603,605,608,610,612,614,
616,618,621,623,625,627,629,632,634,636,638,641,643,645,647,649,652,654,656,659,661,663,665,668,670,
672,675,677,679,681,684,686,688,691,693,696,698,700,703,705,707,710,712,715,717,719,722,724,727,729,
731,734,736,739,741,744,746,749,751,754,756,759,761,764,766,769,771,774,776,779,781,784,786,789,791,
794,797,799,802,804,807,810,812,815,817,820,823,825,828,831,833,836,839,841,844,847,849,852,855,857,
860,863,866,868,871,874,876,879,882,885,888,890,893,896,899,901,904,907,910,913,915,918,921,924,927,
930,933,935,938,941,944,947,950,953,956,959,962,964,967,970,973,976,979,982,985,988,991,994,997};

#endif

#ifdef GAMMA_26
code unsigned int gamma[1000]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,
3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,
7,7,8,8,8,8,8,8,8,9,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,
11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,14,14,14,14,14,14,15,15,15,15,
15,16,16,16,16,16,17,17,17,17,18,18,18,18,18,19,19,19,19,20,20,20,20,20,21,
21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,26,26,26,26,27,27,27,
27,28,28,28,29,29,29,30,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,
35,36,36,36,37,37,37,38,38,38,39,39,39,40,40,40,41,41,41,42,42,43,43,43,44,
44,44,45,45,46,46,46,47,47,48,48,48,49,49,50,50,50,51,51,52,52,53,53,53,54,
54,55,55,56,56,56,57,57,58,58,59,59,60,60,61,61,61,62,62,63,63,64,64,65,65,
66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,78,78,
79,79,80,80,81,81,82,82,83,84,84,85,85,86,86,87,88,88,89,89,90,91,91,92,92,
93,94,94,95,95,96,97,97,98,98,99,100,100,101,102,102,103,104,104,105,105,106,107,107,108,
109,109,110,111,111,112,113,113,114,115,116,116,117,118,118,119,120,120,121,122,123,123,124,125,125,
126,127,128,128,129,130,131,131,132,133,134,134,135,136,137,137,138,139,140,140,141,142,143,144,144,
145,146,147,148,148,149,150,151,152,152,153,154,155,156,156,157,158,159,160,161,162,162,163,164,165,
166,167,168,168,169,170,171,172,173,174,175,175,176,177,178,179,180,181,182,183,184,184,185,186,187,
188,189,190,191,192,193,194,195,196,197,198,199,200,201,201,202,203,204,205,206,207,208,209,210,211,
212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,236,237,
238,239,240,242,243,244,245,246,247,248,249,250,251,253,254,255,256,257,258,259,260,262,263,264,265,
266,267,268,270,271,272,273,274,275,277,278,279,280,281,283,284,285,286,287,289,290,291,292,293,295,
296,297,298,300,301,302,303,305,306,307,308,310,311,312,313,315,316,317,318,320,321,322,324,325,326,
328,329,330,332,333,334,335,337,338,339,341,342,344,345,346,348,349,350,352,353,354,356,357,359,360,
361,363,364,365,367,368,370,371,373,374,375,377,378,380,381,383,384,385,387,388,390,391,393,394,396,
397,399,400,402,403,404,406,407,409,410,412,413,415,417,418,420,421,423,424,426,427,429,430,432,433,
435,437,438,440,441,443,444,446,448,449,451,452,454,455,457,459,460,462,464,465,467,468,470,472,473,
475,477,478,480,482,483,485,487,488,490,492,493,495,497,498,500,502,503,505,507,509,510,512,514,515,
517,519,521,522,524,526,528,529,531,533,535,536,538,540,542,544,545,547,549,551,553,554,556,558,560,
562,563,565,567,569,571,573,574,576,578,580,582,584,586,588,589,591,593,595,597,599,601,603,605,606,
608,610,612,614,616,618,620,622,624,626,628,630,632,634,636,637,639,641,643,645,647,649,651,653,655,
657,659,661,663,665,667,669,672,674,676,678,680,682,684,686,688,690,692,694,696,698,700,702,705,707,
709,711,713,715,717,719,721,724,726,728,730,732,734,736,739,741,743,745,747,749,752,754,756,758,760,
763,765,767,769,771,774,776,778,780,783,785,787,789,792,794,796,798,801,803,805,807,810,812,814,817,
819,821,823,826,828,830,833,835,837,840,842,844,847,849,851,854,856,858,861,863,866,868,870,873,875,
878,880,882,885,887,890,892,894,897,899,902,904,907,909,912,914,916,919,921,924,926,929,931,934,936,
939,941,944,946,949,951,954,956,959,961,964,967,969,972,974,977,979,982,984,987,990,992,995,997};
#endif

#ifdef GAMMA_20
code unsigned int gamma[1000]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,
3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,10,10,10,
10,10,11,11,11,11,11,12,12,12,12,13,13,13,13,13,14,14,14,14,15,15,15,15,16,
16,16,16,17,17,17,17,18,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,23,
23,23,23,24,24,24,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,
31,31,32,32,32,33,33,33,34,34,35,35,35,36,36,36,37,37,38,38,38,39,39,40,40,
40,41,41,42,42,42,43,43,44,44,45,45,45,46,46,47,47,48,48,48,49,49,50,50,51,
51,52,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,
63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,75,75,76,
76,77,77,78,78,79,80,80,81,81,82,82,83,84,84,85,85,86,86,87,88,88,89,89,90,
91,91,92,92,93,94,94,95,95,96,97,97,98,99,99,100,100,101,102,102,103,104,104,105,106,
106,107,108,108,109,110,110,111,112,112,113,114,114,115,116,116,117,118,118,119,120,120,121,122,122,
123,124,125,125,126,127,127,128,129,130,130,131,132,132,133,134,135,135,136,137,138,138,139,140,141,
141,142,143,144,144,145,146,147,147,148,149,150,151,151,152,153,154,154,155,156,157,158,158,159,160,
161,162,162,163,164,165,166,166,167,168,169,170,171,171,172,173,174,175,176,176,177,178,179,180,181,
181,182,183,184,185,186,187,187,188,189,190,191,192,193,194,194,195,196,197,198,199,200,201,202,202,
203,204,205,206,207,208,209,210,211,212,213,213,214,215,216,217,218,219,220,221,222,223,224,225,226,
227,228,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,
251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,274,275,276,
277,278,279,280,281,282,283,284,285,286,287,288,289,291,292,293,294,295,296,297,298,299,300,301,303,
304,305,306,307,308,309,310,311,312,314,315,316,317,318,319,320,321,323,324,325,326,327,328,329,331,
332,333,334,335,336,338,339,340,341,342,343,345,346,347,348,349,350,352,353,354,355,356,358,359,360,
361,362,364,365,366,367,368,370,371,372,373,375,376,377,378,379,381,382,383,384,386,387,388,389,391,
392,393,394,396,397,398,399,401,402,403,404,406,407,408,410,411,412,413,415,416,417,419,420,421,422,
424,425,426,428,429,430,432,433,434,436,437,438,440,441,442,444,445,446,448,449,450,452,453,454,456,
457,458,460,461,462,464,465,466,468,469,471,472,473,475,476,477,479,480,482,483,484,486,487,489,490,
491,493,494,496,497,498,500,501,503,504,506,507,508,510,511,513,514,516,517,518,520,521,523,524,526,
527,529,530,531,533,534,536,537,539,540,542,543,545,546,548,549,551,552,554,555,557,558,560,561,563,
564,566,567,569,570,572,573,575,576,578,579,581,582,584,585,587,588,590,591,593,594,596,598,599,601,
602,604,605,607,608,610,612,613,615,616,618,619,621,623,624,626,627,629,630,632,634,635,637,638,640,
642,643,645,646,648,650,651,653,654,656,658,659,661,663,664,666,667,669,671,672,674,676,677,679,681,
682,684,686,687,689,691,692,694,696,697,699,701,702,704,706,707,709,711,712,714,716,717,719,721,723,
724,726,728,729,731,733,734,736,738,740,741,743,745,746,748,750,752,753,755,757,759,760,762,764,766,
767,769,771,773,774,776,778,780,781,783,785,787,789,790,792,794,796,797,799,801,803,805,806,808,810,
812,814,815,817,819,821,823,824,826,828,830,832,834,835,837,839,841,843,845,846,848,850,852,854,856,
857,859,861,863,865,867,869,870,872,874,876,878,880,882,884,885,887,889,891,893,895,897,899,901,903,
904,906,908,910,912,914,916,918,920,922,924,925,927,929,931,933,935,937,939,941,943,945,947,949,951,
953,955,956,958,960,962,964,966,968,970,972,974,976,978,980,982,984,986,988,990,992,994,996,998};

#endif

#ifdef GAMMA_15
code unsigned int gamma[1000]={
0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,
4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,
12,12,12,13,13,13,14,14,14,15,15,15,16,16,17,17,17,18,18,19,19,19,20,20,21,
21,21,22,22,23,23,23,24,24,25,25,26,26,27,27,27,28,28,29,29,30,30,31,31,32,
32,33,33,34,34,35,35,35,36,36,37,37,38,38,39,40,40,41,41,42,42,43,43,44,44,
45,45,46,46,47,47,48,49,49,50,50,51,51,52,52,53,54,54,55,55,56,56,57,58,58,
59,59,60,60,61,62,62,63,63,64,65,65,66,66,67,68,68,69,69,70,71,71,72,73,73,
74,74,75,76,76,77,78,78,79,80,80,81,82,82,83,83,84,85,85,86,87,87,88,89,89,
90,91,91,92,93,93,94,95,96,96,97,98,98,99,100,100,101,102,102,103,104,105,105,106,107,
107,108,109,110,110,111,112,112,113,114,115,115,116,117,118,118,119,120,121,121,122,123,124,124,125,
126,127,127,128,129,130,130,131,132,133,133,134,135,136,136,137,138,139,140,140,141,142,143,143,144,
145,146,147,147,148,149,150,151,151,152,153,154,155,155,156,157,158,159,159,160,161,162,163,163,164,
165,166,167,168,168,169,170,171,172,173,173,174,175,176,177,178,178,179,180,181,182,183,184,184,185,
186,187,188,189,190,190,191,192,193,194,195,196,197,197,198,199,200,201,202,203,204,204,205,206,207,
208,209,210,211,212,212,213,214,215,216,217,218,219,220,221,221,222,223,224,225,226,227,228,229,230,
231,231,232,233,234,235,236,237,238,239,240,241,242,243,244,244,245,246,247,248,249,250,251,252,253,
254,255,256,257,258,259,260,261,262,263,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,
278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,
303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,
328,329,330,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,354,
355,356,357,358,359,360,361,362,363,364,365,366,367,369,370,371,372,373,374,375,376,377,378,379,380,
381,383,384,385,386,387,388,389,390,391,392,394,395,396,397,398,399,400,401,402,403,405,406,407,408,
409,410,411,412,413,415,416,417,418,419,420,421,422,424,425,426,427,428,429,430,431,433,434,435,436,
437,438,439,441,442,443,444,445,446,447,449,450,451,452,453,454,455,457,458,459,460,461,462,464,465,
466,467,468,469,471,472,473,474,475,476,478,479,480,481,482,483,485,486,487,488,489,491,492,493,494,
495,496,498,499,500,501,502,504,505,506,507,508,510,511,512,513,514,516,517,518,519,520,522,523,524,
525,526,528,529,530,531,533,534,535,536,537,539,540,541,542,544,545,546,547,548,550,551,552,553,555,
556,557,558,560,561,562,563,564,566,567,568,569,571,572,573,574,576,577,578,579,581,582,583,584,586,
587,588,589,591,592,593,594,596,597,598,600,601,602,603,605,606,607,608,610,611,612,613,615,616,617,
619,620,621,622,624,625,626,628,629,630,631,633,634,635,637,638,639,640,642,643,644,646,647,648,650,
651,652,653,655,656,657,659,660,661,663,664,665,666,668,669,670,672,673,674,676,677,678,680,681,682,
684,685,686,688,689,690,692,693,694,696,697,698,700,701,702,704,705,706,708,709,710,712,713,714,716,
717,718,720,721,722,724,725,726,728,729,730,732,733,734,736,737,738,740,741,743,744,745,747,748,749,
751,752,753,755,756,758,759,760,762,763,764,766,767,768,770,771,773,774,775,777,778,780,781,782,784,
785,786,788,789,791,792,793,795,796,798,799,800,802,803,804,806,807,809,810,811,813,814,816,817,818,
820,821,823,824,826,827,828,830,831,833,834,835,837,838,840,841,842,844,845,847,848,850,851,852,854,
855,857,858,860,861,862,864,865,867,868,870,871,872,874,875,877,878,880,881,882,884,885,887,888,890,
891,893,894,895,897,898,900,901,903,904,906,907,908,910,911,913,914,916,917,919,920,922,923,924,926,
927,929,930,932,933,935,936,938,939,941,942,944,945,946,948,949,951,952,954,955,957,958,960,961,963,
964,966,967,969,970,972,973,975,976,978,979,981,982,984,985,987,988,990,991,993,994,996,997,999};

#endif

#ifdef GAMMA_10
code unsigned int gamma[1000]={
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,
26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,
51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,
101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,
126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,
151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,
201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,
226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,
251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,
276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,
301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,
326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,
351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,
376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,
401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,
426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,
451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,
476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,
501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,
526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,
551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,
576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,
601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,
626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,
651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,
676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,
701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,
726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,
751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,
776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,
801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,
826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,
851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,
876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,
901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,
926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,
951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,
976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999};

#endif